﻿namespace Web.Control.Member.User
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Text.RegularExpressions;
    using Lx.Web.Common.UI;
    using Lx.Web.Common.ControlsUI;
    using System.Collections;

    using Model.WWW_User.User;
    using BLF.WWW_User.Users;

    public class ResetMyPassword : BaseControl
    {
        protected System.Web.UI.WebControls.Button ChangPwdButton;
        protected System.Web.UI.WebControls.TextBox PwdAgain;
        protected System.Web.UI.WebControls.TextBox Password;

        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Page.Request["AffirmNo"] != null && Page.Request["MemberNo"] != null)
                {
                    this.ViewState["MemberNo"] = Page.Request["MemberNo"].ToString();
                    this.ViewState["AffirmNo"] = Page.Request["AffirmNo"].ToString();
                    Response.Write("<script>var memberno='" + this.ViewState["MemberNo"]+ "';</script>");
                }
                else
                {
                    Page.Response.End();
                }
                UserModel bum = User.GetDetailUserInfo(this.ViewState["MemberNo"].ToString().Trim());
                if (bum != null)
                {
                    if (Globals.Enctype(bum.AffirmNo) != this.ViewState["AffirmNo"].ToString())
                    {
                        Page.Response.End();
                    }
                }
                else
                {
                    Page.Response.End();
                }
            }
            base.OnLoad(e);
        }
    }
}
